package com.shijingshan.fahaisi;

import com.alibaba.fastjson2.JSONObject;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.protocol.HTTP;
import org.apache.http.util.EntityUtils;

public class FahaisiHttp {

    private  static  String url = "https://www.sjsggwh.com/yuyue/GetSceneList?id=84";

    public static JSONObject get(){

        CloseableHttpResponse response ;
        JSONObject result=null;
        CloseableHttpClient httpclient = HttpClients.createDefault();
        HttpGet get = new HttpGet(url);
        try{
            response = httpclient.execute(get);
            String body = EntityUtils.toString(response.getEntity(), HTTP.UTF_8);
            result = JSONObject.parseObject(body);
            //System.out.println(result);
        }catch (Exception e){
            e.printStackTrace();
        }

        return result;
    }
}
